<h1>Editing user</h1>

<% form_for(@user) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :firstname %>
    <%= f.text_field :firstname %>
  </p>
  <p>
    <%= f.label :lastname %>
    <%= f.text_field :lastname %>
  </p>
  <p>
    <%= f.label :email %>
    <%= f.text_field :email %>
  </p>
  <p> 
    <label for="user_password">Mot de passe:</label> 
    <%= f.password_field :password, :size => 40 %> 
  </p> 
  <p> 
    <label for="user_password_confirmation">Confirmation:</label> 
    <%= f.password_field :password_confirmation, :size => 40 %> 
  </p>
  <p>
    <%= f.label :role_id %><br />
    <%= f.select :role_id, Role.selectable.collect{|r| [r.label,r.id]} %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>